﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ClientCreditCheckHistory.aspx.cs" Inherits="CRMWeb.Pages.Contact.ClientCreditCheckHistory" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <table id="dgClientCreditHistory" style="width: auto" class="esyui-datagrid"
        rownumbers="true" fitcolumns="true" singleselect="true" autorowheight="true" width="70%">
        <thead>
            <tr>
                <th field="CreatedDate1" width="100px">Created Date</th>
                <th field="FullName" width="200px">Full Name</th>
                <th field="VedafileNO" width="100px">Veda file No.</th>
                <th field="CreatedDate" width="150px" data-options="formatter:calculateAge">Record Age</th>
                <th field="CreatedBy" width="200px">Create by</th>
            </tr>
        </thead>
    </table>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#dgClientCreditHistory').datagrid({
                url: '/WebServices/ApplicantCreditCheck.ashx?method=GetSingleVedaCreditCheckHistory&ContactID=' + getQuerystring('contact_id', ''),
                onDblClickRow: function (index, rowdata) {
                    var hostUrl = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '');
                    var myWindow = window.open(hostUrl + '/Pages/Application/VedaResponseData/' + rowdata.XMLFile, '_blank');
                    myWindow.focus();
                }
            });
        });
        function calculateAge(value, row) {
            var date = null;
            if (value == null)
                date = new Date();
            else
                date = new Date(value);
            var y = date.getFullYear();
            var m = date.getMonth() + 1;
            var d = date.getDate();
            return getAge((m < 10 ? ('0' + m) : m) + '/' + (d < 10 ? ('0' + d) : d) + '/' + y);
        }
    </script>
</body>
</html>
